import aiohttp
import asyncio


async def main():
    data = {'name': 'germey', 'age': 25}
    async with aiohttp.ClientSession() as session:
        async with session.post('https://www.httpbin.org/post', data=data) as resp:
            # async with session.post('https://www.httpbin.org/post', json=data) as resp:# json数据提交
            print(await resp.text())


async def run_tasks():
    tasks = [main() for _ in range(3)]
    await asyncio.gather(*tasks)


if __name__ == '__main__':
    asyncio.run(run_tasks())
